<!doctype HTML public "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- Click to Convert 5.2: Anything to HTML -->
<!-- http://www.clicktoconvert.com -->

<html>
<head>
<title>gravityboxscheduleuserguide - page 143 of 234</title>
<meta http-equiv=content-type content=text/html;charset=iso-8859-1>
<meta name="Generator" content="Click to Convert">

<!--Start of page styles-->
<STYLE TYPE="text/css">
<!--
 /* Foreground Image Styles */

 /* Position Styles */
 .ts143p0{position:absolute;left:106px;top:97px;}
 .ts143p1{position:absolute;left:352px;top:97px;}
 .ts143p3{position:absolute;left:665px;top:97px;}
 .ts143p7{position:absolute;left:106px;top:113px;}
 .ts143p8{position:absolute;left:706px;top:1026px;}
 .ts143p9{position:absolute;left:331px;top:1044px;}
 .ts143p13{position:absolute;left:106px;top:146px;}
 .ts143p15{position:absolute;left:106px;top:220px;}
 .ts143p17{position:absolute;left:106px;top:256px;}
 .ts143p20{position:absolute;left:106px;top:275px;}
 .ts143p22{position:absolute;left:106px;top:293px;}
 .ts143p23{position:absolute;left:106px;top:312px;}
 .ts143p24{position:absolute;left:106px;top:330px;}
 .ts143p26{position:absolute;left:106px;top:348px;}
 .ts143p27{position:absolute;left:106px;top:367px;}
 .ts143p28{position:absolute;left:106px;top:385px;}
 .ts143p30{position:absolute;left:106px;top:404px;}
 .ts143p33{position:absolute;left:106px;top:422px;}
 .ts143p35{position:absolute;left:106px;top:440px;}
 .ts143p36{position:absolute;left:106px;top:459px;}
 .ts143p37{position:absolute;left:106px;top:477px;}
 .ts143p39{position:absolute;left:106px;top:496px;}
 .ts143p40{position:absolute;left:106px;top:514px;}
 .ts143p41{position:absolute;left:106px;top:532px;}
 .ts143p43{position:absolute;left:106px;top:551px;}
 .ts143p45{position:absolute;left:106px;top:569px;}
 .ts143p46{position:absolute;left:106px;top:589px;}
 .ts143p48{position:absolute;left:106px;top:607px;}
 .ts143p49{position:absolute;left:106px;top:625px;}
 .ts143p51{position:absolute;left:106px;top:643px;}
 .ts143p52{position:absolute;left:106px;top:661px;}
 .ts143p54{position:absolute;left:106px;top:679px;}
 .ts143p55{position:absolute;left:106px;top:697px;}
 .ts143p57{position:absolute;left:106px;top:716px;}
 .ts143p58{position:absolute;left:106px;top:734px;}
 .ts143p59{position:absolute;left:106px;top:753px;}
 .ts143p60{position:absolute;left:106px;top:771px;}
 .ts143p62{position:absolute;left:106px;top:789px;}
 .ts143p63{position:absolute;left:106px;top:808px;}
 .ts143p65{position:absolute;left:106px;top:826px;}
 .ts143p66{position:absolute;left:106px;top:845px;}
 .ts143p68{position:absolute;left:106px;top:863px;}
 .ts143p72{position:absolute;left:106px;top:881px;}
 .ts143p73{position:absolute;left:106px;top:900px;}
 .ts143p75{position:absolute;left:106px;top:918px;}
 .ts143p76{position:absolute;left:106px;top:938px;}
 .ts143p78{position:absolute;left:106px;top:956px;}
 .ts143p79{position:absolute;left:106px;top:974px;}

 /* Font Styles */
 .ft0p143{font-style:normal;font-weight:bold;font-size:13px;font-family:arial,sans-serif;color:#000000;}
 .ft1p143{font-weight:normal;}
 .ft2p143{font-style:normal;font-weight:normal;font-size:13px;font-family:"times new roman","times new roman",times,serif;color:#000000;}
 .ft3p143{font-style:normal;font-weight:normal;font-size:16px;font-family:"times new roman","times new roman",times,serif;color:#000000;}
 .ft4p143{font-style:normal;font-weight:bold;font-size:11px;font-family:arial,sans-serif;color:#000000;}
 .ft5p143{font-style:normal;font-weight:normal;font-size:32px;font-family:helvetica,arial,sans-serif;color:#000000;}
 .ft6p143{font-style:normal;font-weight:bold;font-size:21px;font-family:arial,sans-serif;color:#808080;}
 .ft7p143{font-style:normal;font-weight:normal;font-size:16px;font-family:arial,sans-serif;color:#000000;}
 .ft8p143{font-style:normal;font-weight:normal;font-size:16px;font-family:"courier new",courier,monospace;color:#000000;}

 /* Background Style */
 .styleBackground143{position:absolute;left:97px;top:587px}

 /* Navigation Styles */
 .styleNavBarTop{position:absolute;left:0px;top:2px}
 .nb{position:absolute;left:2px;top:0px}
 .nbs{position:absolute;left:0px;top:0px}
 .nbe{position:absolute;left:836px;top:0px}
 .styleNavBarBot{position:absolute;left:0px;top:1117px}
-->
</STYLE>
<!--End of page styles-->

</head>
<body bgcolor="#ffffff" text="#000000" link="#0000FF" Vlink="#660099">

<table id="pageTable" width="836" STYLE="position: relative; left: auto; top: auto;"><tr><td>
<div class=nbs><img src="./navbarstart.gif" width="2" height="30"></div>
<div class=nb><img src="./navbar.gif" width="836" height="30" alt="Navigation bar"></div>
<div class=nbe><img src="./navbarend.gif" width="2" height="30"></div>
<div class=styleNavBarTop>
<table width="834" height="26" border="0" cellspacing="0">
  <tr align="left">
    <td width="4">&nbsp;</td>
    <td width="25" align="center"><a href="http://www.gravitybox.com" target="_parent"><img src="./home.gif" border="0" alt="Home"></a></td>
    <td width="25" align="center"><a href="#" onClick="window.open('./print.html','Printing','width=300,height=100,toolbar=no,directories=no');return false;"><img src="./print.gif" border="0" alt="Print document"></a></td>
    <td width="10" align="center"><img src="./separator.gif" border="0"></td>
    <td width="18" align="center"><a href="./index1.html"><img src="./start.gif" width="18" height="14" border="0" alt="Start"></a></td>
    <td width="18" align="center"><a href="./index142.html"><img src="./back.gif" width="14" height="14" border="0" alt="Previous page"></a></td>
    <td width="80" valign="middle"><table width="100%" height="16" border="0" cellspacing="1" bgcolor="#ACA899"><tr><td align="center" bgcolor="#ffffff"><font face=verdana,arial,sans-serif><font size="1">&nbsp;143 of 234&nbsp;</font></font></td></tr></table></td>
    <td width="18" align="center"><a href="./index144.html"><img src="./forward.gif" width="14" height="14" border="0" alt="Next page"></a></td>
    <td width="18" align="center"><a href="./index234.html"><img src="./end.gif" width="18" height="14" border="0" alt="End"></a></td>
    <td width="620">&nbsp;</td>
  </tr>
</table>
<p>
</div>
<nobr>
<div class=styleBackground143><img src="./background143.png" width="633" height="468" border="0" alt=""></div>
<div class=ts143p0><span class="ft0p143"> </span></div>
<div class=ts143p1><span class="ft0p143">Gravitybox Schedule Primer<span class="ft1p143"> </span></span></div>
<div class=ts143p3><span class="ft0p143">Page 141&nbsp; </span></div>
<div class=ts143p7><span class="ft2p143"> </span></div>
<div class=ts143p8><span class="ft3p143"> </span></div>
<div class=ts143p9><span class="ft4p143">1998&#45;2004 Gravitybox Software LLC<span class="ft3p143"> </span></span></div>
<div class=ts143p13><span class="ft5p143">Chapter 14 </span></div>
<div class=ts143p15><span class="ft6p143">Scheduling Program </span></div>
<div class=ts143p17><span class="ft7p143">It should be self&#45;explanatory how a day schedule works in normal mode. You just drop a </span></div>
<div class=ts143p20><span class="ft7p143">schedule on a form, set the MinDate and MaxDate and you are done. This is not much </span></div>
<div class=ts143p22><span class="ft7p143">of an example from which to learn. So I have chosen to make our first real application a </span></div>
<div class=ts143p23><span class="ft7p143">bit more complex. We will create an MDI interface and open a new child window for </span></div>
<div class=ts143p24><span class="ft7p143">each day. Instead of having just one column for the day, we will schedule rooms. This </span></div>
<div class=ts143p26><span class="ft7p143">example assumes that we are building an application for a doctor&#146;s office. In this </span></div>
<div class=ts143p27><span class="ft7p143">fictional office we are required to schedule patients in different rooms of the office. This </span></div>
<div class=ts143p28><span class="ft7p143">is important because in an office you may have 10 patients scheduled at 10:00 AM; </span></div>
<div class=ts143p30><span class="ft7p143">however they will be in different rooms. This is a real&#45;world example and one that many </span></div>
<div class=ts143p33><span class="ft7p143">developers have had to build. </span></div>
<div class=ts143p35><span class="ft7p143"> </span></div>
<div class=ts143p36><span class="ft7p143">We may construct a simple scheduling application that still presents much of the </span></div>
<div class=ts143p37><span class="ft7p143">functionality of the schedule component. We will be able to create a new schedule. Also </span></div>
<div class=ts143p39><span class="ft7p143">we will be able to open an existing schedule. Finally, we will be able to save and print </span></div>
<div class=ts143p40><span class="ft7p143">schedules. The first thing to do is to create the needed forms. We will need an MDI and </span></div>
<div class=ts143p41><span class="ft7p143">a child form. On the child form we will place a GbSchedule object. To ensure that the </span></div>
<div class=ts143p43><span class="ft7p143">schedule is the proper size we will need to add a little code to the resize event. </span></div>
<div class=ts143p45><span class="ft7p143"> </span></div>
<div class=ts143p46><span class="ft8p143">Private Sub Form_Resize() </span></div>
<div class=ts143p48><span class="ft8p143"> </span></div>
<div class=ts143p49><span class="ft8p143">On Error Resume Next </span></div>
<div class=ts143p51><span class="ft8p143"> </span></div>
<div class=ts143p52><span class="ft8p143">&nbsp; Schedule1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight </span></div>
<div class=ts143p54><span class="ft8p143"> </span></div>
<div class=ts143p55><span class="ft8p143">End Sub <span class="ft7p143"> </span></span></div>
<div class=ts143p57><span class="ft7p143"> </span></div>
<div class=ts143p58><span class="ft7p143">This code will not cause any error if the form is minimized because it skips all errors. </span></div>
<div class=ts143p59><span class="ft7p143">The only errors that could occur are resizing errors and there is nothing to be done </span></div>
<div class=ts143p60><span class="ft7p143">about those anyway, so we will ignore them. </span></div>
<div class=ts143p62><span class="ft7p143"> </span></div>
<div class=ts143p63><span class="ft7p143">Next we will add some rooms to the schedule. You may, of course, add a configuration </span></div>
<div class=ts143p65><span class="ft7p143">screen to setup rooms. This is the obvious thing to do especially it you are deploying </span></div>
<div class=ts143p66><span class="ft7p143">your application to many clients and do not know their room configuration at design&#45;</span></div>
<div class=ts143p68><span class="ft7p143">time. However, for the simplicity of this example we will just hard&#45;wire the rooms. I have </span></div>
<div class=ts143p72><span class="ft7p143">created a routine to add rooms to the schedule and it is called from the Form_Load </span></div>
<div class=ts143p73><span class="ft7p143">event. This routine will add four rooms to the schedule. </span></div>
<div class=ts143p75><span class="ft7p143"> </span></div>
<div class=ts143p76><span class="ft8p143">Private Sub LoadRooms() </span></div>
<div class=ts143p78><span class="ft8p143"> </span></div>
<div class=ts143p79><span class="ft8p143">&nbsp; 'We will now load the rooms for this day. </span></div>
<div class=styleNavBarBot>
<table width="836" border="0" cellspacing="2">
  <tr></tr>
  <tr>
    <td width="118"><a href="http://www.purepage.com"><img src="./smalllogo.gif" width="118" height="46" border="0" alt="http://www.purepage.com"></a></td>
    <td></td>
  </tr>
</table>
</div>

</td></tr></table>

</body>
</html>
